package conf

import (
	"bilibi.com/comment/library/cache/redis"
	"bilibi.com/comment/library/database/orm"
	bm "github.com/bilibili/kratos/pkg/net/http/blademaster"
	xtime "github.com/bilibili/kratos/pkg/time"
	"time"
)

var (
	// Conf config
	Conf = &Config{
		BM: &bm.ServerConfig{
			Addr:    "0.0.0.0:8000",
			Timeout: xtime.Duration(time.Second),
		},
		ORM: &orm.Config{
			DSN:         "root:root@tcp(127.0.0.1:3306)/bugu-comments?charset=utf8&parseTime=True&loc=Local",
			Active:      5,
			Idle:        5,
			IdleTimeout: time.Duration(time.Hour * 4),
		},
		REDIS: &redis.Config{
			Addr:         "test.mudu.tv:6379",
			Auth:         "fXaHIr6dTQffrIxM",
			PoolTimeout:  time.Duration(time.Second * 15),
			ReadTimeout:  time.Duration(time.Second * 10),
			WriteTimeout: time.Duration(time.Second * 10),
		},
		CommentRPCAddr: "localhost:9000",
	}
)

// Config .
type Config struct {
	BM             *bm.ServerConfig
	ORM            *orm.Config
	REDIS          *redis.Config
	CommentRPCAddr string
}
